package cn.iocoder.ny.module.mall.service;


import cn.iocoder.ny.module.mall.domain.vo.MallWeChatPayVo;
import cn.iocoder.ny.module.mall.utils.wxpay.ResultModel;
import com.wechat.pay.java.service.payments.jsapi.model.PrepayWithRequestPaymentResponse;
import com.wechat.pay.java.service.payments.model.Transaction;
import com.wechat.pay.java.service.refund.model.Refund;
import com.wechat.pay.java.service.refund.model.RefundNotification;

import javax.servlet.http.HttpServletRequest;

/**
 * @author lc
 * @date 2024/07/23/ 11:54
 * @description:
 */
public interface IMallWxPayService {

    /**
     * 微信小程序支付
     *
     * @param vo
     * @return
     */
    ResultModel<PrepayWithRequestPaymentResponse> prepayByJsapi(MallWeChatPayVo vo);


    ResultModel<PrepayWithRequestPaymentResponse> newpay(MallWeChatPayVo vo);

    /**
     * 微信支付回调
     *
     * @param request
     * @param appId
     * @return
     */
    ResultModel<com.wechat.pay.java.service.payments.model.Transaction> notify(HttpServletRequest request, String appId );


    /**
     * 微信支付查询
     *
     * @param vo
     * @return
     */
    ResultModel<com.wechat.pay.java.service.payments.model.Transaction> queryByOutTradeNo(MallWeChatPayVo vo);

    /**
     * 微信支付关闭
     */
    ResultModel<Transaction> closeByOutTradeNo(MallWeChatPayVo vo);


    /**
     * 微信支付退款
     * @param vo
     * @return
     */
    ResultModel<Refund> refundsByOutTradeNo(MallWeChatPayVo vo);

    /**
     * 退款结果通知
     */
    ResultModel<RefundNotification> refundNotify(HttpServletRequest request, String appId);

    /**
     *
     * 支付退款查询
     * @param vo
     * @return
     */
    ResultModel<Refund> refundsQueryByOutRefundNo(MallWeChatPayVo vo);
}
